#!/usr/bin/env python

import datetime as dt
from sys import argv

def compare_time(start, end):
	start_dt = dt.datetime.strptime(end,   '%H:%M')
	end_dt   = dt.datetime.strptime(start, '%H:%M')

	diff = (start_dt - end_dt)
	return diff

def sum_time(start, end):
	start_dt = dt.datetime.strptime(start, '%H:%M')
	end_dt   = dt.datetime.strptime(end,   '%H:%M')

	tsum = (start_dt + end_dt)
	return tsum

if __name__ == "__main__":

	"""
	input_1_start = raw_input("Entrada manha (00:00): ") 
	input_1_end   = raw_input("Saida manha (00:00): ")
	input_2_start = raw_input("Entrada tarde (00:00): ")
	input_2_end   = raw_input("Saida tarde (00:00): ")
	"""	

	if len(argv) < 5:
		print "Must be 5 args"
		exit(-1)

	input_1_start = argv[1] 
	input_1_end   = argv[2]
	input_2_start = argv[3]
	input_2_end   = argv[4]
	plus = 0

	morning = compare_time(input_1_start, input_1_end)
	evening = compare_time(input_2_start, input_2_end)

	total = morning + evening

	try:
		plus = argv[5]
	except IndexError:
		pass

	print "Total %s" % total
	
	if plus != 0:
		res = total.__str__().split(":")
		print "Plus %s" % compare_time("%s:%s" % (res[0],res[1]),plus) 
